<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.css">
</head>
<body>

    <div class="container">
        <h1>修改商品信息</h1>
        <form th:action="@{/brand/doUpdateBrand}" method="post">

        <div>
            <div class="form-group">
                <!-- for属性: 点击 name  , 会选中下面的表单-->
                <label for="Id">Id</label>
                <input type="text" class="form-control" id="Id" name="id" th:value="${brand.id}" readonly />
            </div>


            <div class="form-group">
                <!-- for属性: 点击 name  , 会选中下面的表单-->
                <label for="nameId">name</label>
                <input type="text" class="form-control" id="nameId" name="name" th:value="${brand.name}" />
            </div>

            <div class="form-group">
                <label for="remarkId">Remark</label>
                <!--<textarea class="form-control" id="remarkId" rows="5" cols="100" name="remark"
                         >[[${brand.remark}]]</textarea>-->
                <textarea class="form-control" id="remarkId" rows="5" cols="100" name="remark"
                          th:text="${brand.remark}"></textarea>
                <!--在 textarea 中设置值的时候, 最好选用 th:text的形式-->
            </div>

            <button type="submit" class="btn btn-default" onclick="updateBrand()">修改</button>



        </div>


        </form>
    </div>

    <script type="text/javascript">
        function updateBrand() {

            let id = document.forms[0].id.value;
            console.log(id);
            let name = document.forms[1].name.value;
            console.log(name);
            let remark = document.forms[2].remark.value;
            console.log(remark);


        }
    </script>



</body>
</html>